using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._IntelligenceTools._Movement
{
    /// <summary>
    /// <para>Classify Movement Events</para>
    /// <para>Identifies turn events, acceleration events, and speed from an input point track dataset.</para>
    /// <para>从输入点轨迹数据集中识别转弯事件、加速事件和速度。</para>
    /// </summary>    
    [DisplayName("Classify Movement Events")]
    public class ClassifyMovementEvents : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ClassifyMovementEvents()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>A time-enabled point feature layer with a field annotating the track with which each point is associated. The geometry, object identifier, track name, and time will be transferred to the output feature class. The input must be in a projected coordinate system.</para>
        /// <para>启用时间的点要素图层，其字段用于注记与每个点关联的轨迹。几何、对象标识符、轨迹名称和时间将传输到输出要素类。输入必须位于投影坐标系中。</para>
        /// </param>
        /// <param name="_id_field">
        /// <para>ID Field</para>
        /// <para>A field from the input features that will be used to obtain the unique identifiers per point track. The field will be copied to the output feature class.</para>
        /// <para>输入要素中的字段，用于获取每个点轨迹的唯一标识符。该字段将复制到输出要素类。</para>
        /// </param>
        /// <param name="_out_featureclass">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class that will contain the calculated movement events.</para>
        /// <para>将包含计算的移动事件的输出要素类。</para>
        /// </param>
        public ClassifyMovementEvents(object _in_features, object _id_field, object _out_featureclass)
        {
            this._in_features = _in_features;
            this._id_field = _id_field;
            this._out_featureclass = _out_featureclass;
        }
        public override string ToolboxName => "Intelligence Tools";

        public override string ToolName => "Classify Movement Events";

        public override string CallName => "intelligence.ClassifyMovementEvents";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "parallelProcessingFactor", "workspace"];

        public override object[] ParameterInfo => [_in_features, _id_field, _out_featureclass, _curvature, _number_of_points, _regions_of_interest, _roi_id_field];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>A time-enabled point feature layer with a field annotating the track with which each point is associated. The geometry, object identifier, track name, and time will be transferred to the output feature class. The input must be in a projected coordinate system.</para>
        /// <para>启用时间的点要素图层，其字段用于注记与每个点关联的轨迹。几何、对象标识符、轨迹名称和时间将传输到输出要素类。输入必须位于投影坐标系中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>ID Field</para>
        /// <para>A field from the input features that will be used to obtain the unique identifiers per point track. The field will be copied to the output feature class.</para>
        /// <para>输入要素中的字段，用于获取每个点轨迹的唯一标识符。该字段将复制到输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _id_field { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class that will contain the calculated movement events.</para>
        /// <para>将包含计算的移动事件的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_featureclass { get; set; }


        /// <summary>
        /// <para>Curvature</para>
        /// <para><xdoc>
        ///   <para>The minimum value that is necessary for an event to be classified as a turn event. After the curvature is calculated, any calculated curvature greater than this value will cause the turn_event field to be populated with the relevant turn event, while values less than this will cause the turn_event field to be classified as Traveling.</para>
        ///   <para>Turns are calculated using the Curvature and Number Of Points parameters. Each point is evaluated based on the bearing from the previous point in the track to the current point and from the current point to the next point in the track. If the value exceeds the value specified in the Curvature parameter, it is considered a turn. Otherwise, it is considered to be traveling. For tracks representing large objects, it is recommended that you increase the Number Of Points value to account for the longer amount of time to conduct a turn.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将事件归类为轮转事件所需的最小值。计算曲率后，任何计算出的大于此值的曲率都会导致turn_event场填充相关的转弯事件，而小于此值的值将导致turn_event场被归类为行进。</para>
        ///   <para>使用曲率和点数参数计算匝数。每个点都根据从轨道中的上一个点到当前点以及从当前点到轨道中的下一个点的方位角进行评估。如果该值超过曲率参数中指定的值，则将其视为转弯。否则，将被视为旅行。对于表示大型物体的轨迹，建议您增加“点数”（Number Of Points） 值，以考虑进行转弯的较长时间。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Curvature")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _curvature { get; set; } = 15;


        /// <summary>
        /// <para>Number Of Points</para>
        /// <para>The number of points that will be evaluated before and after a given point when calculating the bearing difference. When using data with a high sampling rate (subsecond), you may need to increase the Number Of Points parameter value to account for the decreased movement that is possible in that brief time period. A value of 1 is suitable for automobiles and pedestrians assuming a one-second sampling on the input data. Larger values are necessary for aircraft and ships, and a default value of 5 should be used.</para>
        /// <para>计算方位角差时，在给定点之前和之后将评估的点数。使用高采样率（亚秒）的数据时，可能需要增加点数参数值，以考虑在该短暂时间段内可能减少的移动。值 1 适用于假设对输入数据进行 1 秒采样的汽车和行人。飞机和船舶需要更大的值，应使用默认值 5。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number Of Points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_of_points { get; set; } = 1;


        /// <summary>
        /// <para>Regions Of Interest</para>
        /// <para>The regions of interest. This input feature layer must be a polygon feature class. If a value is provided, a roi field will be added to the Output Feature Class parameter.</para>
        /// <para>感兴趣的区域。此输入要素图层必须为面要素类。如果提供了值，则 roi 字段将添加到输出要素类参数中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Regions Of Interest")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _regions_of_interest { get; set; } = null;


        /// <summary>
        /// <para>Regions Of Interest ID Field</para>
        /// <para>A field from the Regions Of Interest parameter that contains the unique identifiers for each region of interest.</para>
        /// <para>“感兴趣区域”参数中的字段，其中包含每个感兴趣区域的唯一标识符。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Regions Of Interest ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _roi_id_field { get; set; } = null;


        public ClassifyMovementEvents SetEnv(object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}